{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import FLib as f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function add_pro_auto in module FLib:\n",
      "\n",
      "add_pro_auto(List)\n",
      "    [warning]:if you input such as x1y1, y1x1 will automatically added\n",
      "    [input_type]:str\n",
      "    [format]: name1,value1;name2,value2 ...\n",
      "    [value]: integer / integer (eg:3/4)\n",
      "    :return: (None)\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(f.add_pro_auto"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x1:0.4 successful added!\n",
      "x2:0.2 successful added!\n",
      "x3:0.2 successful added!\n",
      "x4:0.1 successful added!\n",
      "x5:0.05 successful added!\n",
      "x6:0.05 successful added!\n"
     ]
    }
   ],
   "source": [
    "f.add_pro_auto('x1,0.4;x2,0.2;x3,0.2;x4,0.1;x5,0.05;x6,0.05')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x7:0.19 successful added!\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2.395928676331139"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f.add_pro_auto('x7,0.19')\n",
    "f.I_sef('x7')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ans = 1.32193 bit\n",
      "ans = 2.32193 bit\n",
      "ans = 2.32193 bit\n",
      "ans = 3.32193 bit\n",
      "ans = 4.32193 bit\n",
      "ans = 4.32193 bit\n"
     ]
    }
   ],
   "source": [
    "for i in range(1,7):\n",
    "    f.print_b(f.I_sef(f.cn_('x',i)))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# def Trans_real2binary(num, l):\n",
    "    s = ''\n",
    "    for i in range(l):\n",
    "        remain = num*2\n",
    "        if remain >= 1:\n",
    "            s = s + 1\n",
    "            remain = remain - "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
